#include <stdio.h>

/*
* II_1.c
*
*  Created on: April, 19, 2009
*      Author: yimingliu@fudan.edu.cn
*/

unsigned long funII_1_Style1_Recursion(int n)
{
	if(n==0)
		return 0;
	if(n==1)
		return 1;
	else
		return funII_1_Style1_Recursion(n-2)+funII_1_Style1_Recursion(n-1);
}

unsigned long funII_1_Style1(int n)
{
	int i;
	for(i=0;i<n;i++)
	{
		printf("%d, ",funII_1_Style1_Recursion(i));
	}
	printf("\n");
}

unsigned long funII_1_Style2(int n)
{
	int i;
	int a=0,b=1;
	for(i=0;i<n;i++)
	{
		if(i==0)
			printf("%d, ",a);
		else if(i==1)
			printf("%d, ",b);
		else
		{
			printf("%d, ",a+b);
			b=a+b;
			a=b-a;
		}
	}
	printf("\n");
}

void funII_1()
{
	int n;
	scanf("%d",&n);
	funII_1_Style1(n);
	funII_1_Style2(n);
}
